package cn.cheln.explorer.ui;

import android.view.View;
import android.view.ViewGroup;
import android.widget.Adapter;
import android.widget.AdapterView;

import cn.cheln.support.ui.adapter.MapAdapter.AdaptInfo;

public class ViewStyle {
	public static final String SharedPreferenceKey = "showStyle";
	public static final String ShowStyle_List = "list";
	public static final String ShowStyle_Grid_3 = "grid-clumn-3";
	public static final String ShowStyle_Grid_4 = "grid-clumn-3";
	public AdapterView adapterView;
	public int layoutItemId;
	public AdaptInfo adapterInfo;
	public Adapter adapter;
	public int clumnNum;
	
	

	public ViewStyle(AdapterView adapterView, int layoutItemId,
			AdaptInfo adapterInfo, Adapter adapter, int clumnNum) {
		super();
		this.adapterView = adapterView;
		this.layoutItemId = layoutItemId;
		this.adapterInfo = adapterInfo;
		this.adapter = adapter;
		this.clumnNum = clumnNum;
	}

	public static View ShowUniqueChild(ViewGroup vgoup, View toShowView) {
		View view;
		for (int i = 0; i < vgoup.getChildCount(); i++) {
			view = vgoup.getChildAt(i);
			view.setVisibility(view != toShowView ? View.GONE : View.VISIBLE);			
		}
		return toShowView;
	}

}
